//
//  UIView+Nib.m
//  CharonTVProject
//
//  Created by karong on 2023/6/26.
//

#import "UIView+Nib.h"

@implementation UIView (Nib)

+ (instancetype)loadFromNib
{
    NSString *nibName = NSStringFromClass([self class]);
    return [self loadFromNibWithName:nibName];
}

+ (instancetype)loadFromNibWithName:(NSString *)nibName
{
    NSArray *array = [[NSBundle mainBundle] loadNibNamed:nibName owner:nil options:nil];
    UIView *view = array.firstObject;
    return view;
}

@end
